
void main(List<String> args) {
  Person p=Person.aa();
  p.age=12;
  p.name="老高";
  print(p.age);


  print(p._name);

Person p1=Person(age:50,aname: "123456");
print(p1.age);

print(p1._name);
p1._eat();
print(p1._name);



}

class Person{
  String? name;
  int age=10;
  String? sex;
  String? _name;

  Person({int? age,String? name,String? sex,String? aname}){
    if(age != null){
      this.age=age;
    }
    if(name !=null){
      this.name=name;
    }
    if(sex != null){
      this.sex=sex;
    }
    if(aname != null){
      this._name=aname;
    }
  }



  Person.aa(){
    print("我是默认构造函数");
  }

  eat(){
    print("我是干饭人");
  }

  _eat(){
    print("_我是干饭人");
  }
}